Fix `cargo search -h`
authorAlex Crichton <alex@alexcrichton.com>
Wed, 8 Apr 2015 18:33:15 +0000 (11:33 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 8 Apr 2015 18:33:15 +0000 (11:33 -0700)
That usage didn't match any docopt patterns so one just needed to be added.

Closes #1497

src/bin/search.rs
tests/test_cargo_search.rs

index 63dbaf73ea17916393c229acf8ae07f5ff880347..ee638cc5d6f3368b3c7049d69b1a45c9a475354b 100644 (file)
@@ -13,6 +13,7 @@ Search packages in crates.io
 
 Usage:
     cargo search [options] <query>
+    cargo search [-h | --help]
 
 Options:
     -h, --help              Print this message
index 667a66cdcbcc3c4316579c841740561c597cbe11..6e55047f1d339cea92f91d003b2ca16647186487 100644 (file)
@@ -85,3 +85,10 @@ test!(simple {
 {updating} registry `[..]`
 hoare (0.1.1)    Design by contract style assertions for Rust", updating = UPDATING)));
 });
+
+test!(help {
+    assert_that(cargo_process("search").arg("-h"),
+                execs().with_status(0));
+    assert_that(cargo_process("help").arg("search"),
+                execs().with_status(0));
+});